import * as YvanUI from 'yvan-ui-wotu'

interface Ref {
    t1: YvanUI.Text,
    t2: YvanUI.Text
}

const React = YvanUI.React
const {Card} = YvanUI.Antd
const Observer = YvanUI.Observer
const _ = YvanUI.lodash

export default class SimpleRadio extends YvanUI.Scope<void, Ref> {

    main = this.$$({
        type: '',
        type2: ''
    })

    onRender() {
        window['biz'] = this
    }

    vjson = {
        title: '极简-单选',
        items: [
            {
                view: 'form',
                debug: 'main',
                items: [
                    {
                        view: 'radio',
                        label: '每周',
                        bind: 'main.type',
                        data: [
                            {label: '周一', value: '1'},
                            {label: '周二', value: '2'},
                            {label: '周三', value: '3'},
                            {label: '周四', value: '4'},
                            {label: '周五', value: '5'},
                            {label: '周六', value: '6'},
                            {label: '周日', value: '0'},
                        ]
                    },
                    {
                        view: 'radio',
                        label: '时间',
                        bind: 'main.type2',
                        optionType: 'button',
                        buttonStyle: 'solid',
                        data: Array.from({length: 24}, (v, index) => ({
                            value: index,
                            label: `${index}:00`
                        })),
                    },
                ]
            }
        ]
    }
}